package com.pkk.penguin.frame.know.java.driven.ext.beanfactorypostprocess.bean;

import java.util.Objects;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;

/**
 * 一个Bean
 *
 * @author peikunkun
 * @version V1.0
 * @date 2020-11-13 11:35
 **/
@Slf4j
public class Blue {

  private String name;


  private String age;

  public Blue() {
    log.info(this.getClass().getSimpleName() + " Constructor  *******************");
  }

  public Blue(String name) {
    log.info(this.getClass().getSimpleName() + " Constructor  设置属性的被加载了-[{}]*******************", name);
    this.name = name;
  }

  public void exec() {
    log.info(this.getClass().getSimpleName() + ".exec() Running  *******************");
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
    log.info(this.getClass().getSimpleName() + ".设置属性的也被运行了 Running 【{}】  *******************", name);
  }

  public String getAge() {
    return age;
  }

  public void setAge(String age) {
    this.age = age;
  }

  public static Logger getLog() {
    return log;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    Blue blue = (Blue) o;
    return Objects.equals(name, blue.name) &&
        Objects.equals(age, blue.age);
  }

  @Override
  public int hashCode() {
    return Objects.hash(name, age);
  }
}
